import request from '@/utils/request'

export function getRegionCheck(areaLevel, pageIndex, pageSize, userName, account, areaId, beginDate, endDate){
  return request({
    url: '/user/area/' + areaLevel,
    method: 'get',
    // params:  { userName, account, areaId, beginDate, endDate }
    params:{ pageIndex,pageSize, userName, account, areaId, beginDate, endDate}
  })
}
// 新增用户，以及加上与区域和角色的关联
export function addRegionCheck(data, areaId){
  return request({
    url: '/user/area/' + areaId,
    method: 'post',
    data
  })
}
// 更改用户信息 包括其对应的区域以及角色
export function updateRegionCheck(data, areaIdList){
  return request({
    url: '/user/user/jail',
    method: 'put',
    params: { areaIdList },
    data
  })
}

export function deleteAdmin(userId){
  return request({
    url:'/user/user/' + userId,
    method: 'delete'
  })
}